#!/bin/bash

DOCKER_REGISTRY=${DOCKER_REGISTRY:-'127.0.0.1:5042'}

sudo mkdir -p /opt/solum
sudo chown -R ${USER}:${USER} /opt/solum

sudo mkdir -p /var/log/solum
sudo chown -R ${USER}:${USER} /var/log/solum

mkdir -p /opt/solum/apps

HERE=$(dirname $0)
CHEF_DOCKERFILE=$HERE/../../../examples/language-packs/chef

echo Creating chef docker image
sudo docker build -t solum/chef $CHEF_DOCKERFILE
docker tag solum/chef $DOCKER_REGISTRY/chef
